export NVS_HOME="$HOME/.nvs"
[ -s "$HOME/.nvs/nvs.sh" ] && . "$HOME/.nvs/nvs.sh"
if command -v nvs &>/dev/null; then
  echo "nvs 已安装$(nvs -v)"
  nvs remote taobao https://cdn.npmmirror.com/binaries/node/
  nvs remote default taobao
  nvs add 18
  nvs use 18
  nvs link 18
  corepack enable
  npm config set cache ~/nodeCache/.npm
  npm config set registry 'https://registry.npmmirror.com/'
  yarn config set registry 'https://registry.npmmirror.com/'
  yarn config set cache-folder ~/nodeCache/.yarn
  pnpm config set store-dir ~/nodeCache/.pnpm-store
  # 配置git全局自动设置远程分支 启用后，执行`git push`时会自动为本地分支设置对应的远程追踪分支
  git config --global push.autoSetupRemote true
  # 提交时转换为LF，检出时不转换
  git config --global core.autocrlf input
  # 记住 http 方式克隆仓库的密码
  git config --global credential.helper store
  # 设置提交代码时的用户信息
  git config --global user.name LinJieLinLin
  git config --global user.email 993353454@qq.com
else
  echo "error!!!请检查nvs安装情况!"
fi
